﻿/**********************************天使物流*******************************************
* 功能描述:基本信息-车辆
* 作者:李周蓬
* 时间:
* 
**********************************天使物流*******************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.Models.BaseInfo.Cars;
using TianShiProject.Models.Common;
using Volo.Abp.Application.Services;

namespace TianShiProject.BaseInfo.Cars
{
    public class CarService : ApplicationService
    {
        private readonly ICarRepository _car;
        public CarService(ICarRepository car)
        {
            _car = car;
        }
        /// <summary>
        /// 显示查询分页
        /// </summary>
        /// <param name="carBrand"></param>
        /// <param name="license"></param>
        /// <param name="driverName"></param>
        /// <param name="companyId"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<CarDto>> GetShowCar(string carBrand, string license, string driverName, int? companyId, int pageindex=1, int pagesize=3)
        {
            return await _car.GetShowCar(carBrand,license,driverName,companyId,pageindex,pagesize);
        }
        /// <summary>
        /// 测试
        /// </summary>
        /// <returns></returns>
        public async Task<List<CarDto>> GetShowCars()
        {
            return await _car.GetShowCars();
        }
        /// <summary>
        /// 显示公司
        /// </summary>
        /// <returns></returns>
        public async Task<List<CompanyDto>> GetShowCompany()
        {
            return await _car.GetShowCompany();
        }
        /// <summary>
        /// 删除车辆
        /// </summary>
        /// <returns></returns>
        public async Task<int> DeleteDelCar(int id)
        {
            return await _car.DeleteDelCar(id);
        }
        /// <summary>
        /// 批量删除车辆
        /// </summary>
        /// <returns></returns>
        public async Task<int> DeleteDelsCar(string ids)
        {
            return await _car.DeleteDelsCar(ids);
        }
        /// <summary>
        /// 编辑修改
        /// </summary>
        /// <param name="carDto"></param>
        /// <returns></returns>
        public async Task<int> PutUpdateCar(CarDto carDto)
        {
            return await _car.PutUpdateCar(carDto);
        }
        /// <summary>
        /// 添加车辆
        /// </summary>
        /// <param name="carDto"></param>
        /// <returns></returns>
        public async Task<int> PostAddCar(CarDto carDto)
        {
            return await _car.PostAddCar(carDto);
        }
        public async Task<object> Addsss()
        {
            return await _car.Addsss();
        }
    }
}
